package com.mpsc.flowable.modeler.controller;

import com.mpsc.api.common.BaseResponse;
import com.mpsc.flowable.modeler.dto.StartProcessDto;
import com.mpsc.flowable.modeler.service.TaskProcessService;
import org.flowable.engine.RuntimeService;
import org.flowable.task.api.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@RequestMapping("/task/process")
public class TaskProcessController {

    @Autowired
    private TaskProcessService taskProcessService;
    @Autowired
    private RuntimeService runtimeService;

    @PostMapping("/start/process")
    public BaseResponse startProcessByKey(@RequestBody StartProcessDto startProcess){
        List<Task> taskList = taskProcessService.startProcessByKey(startProcess);
        return new BaseResponse();
    }



}
